package com.controller;

import com.config.IsAdmin;
import com.service.ProductService;
import com.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class IndexController {

    @Autowired
    UserService userService;

    @Autowired
    ProductService productService;
    @RequestMapping("/index")
//    @IsAdmin
    public Object index(){
        return productService.list();
    }
}
